package com.heima.search.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.heima.common.dtos.ResponseResult;
import com.heima.model.search.dtos.UserSearchDto;
import com.heima.model.search.pojos.ApAssociateWords;
import com.heima.search.service.AssociateService;
import org.checkerframework.common.value.qual.IntRangeFromPositive;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/v1/associate")
public class AssociateController {
    @Resource
    private AssociateService associateService;
    @PostMapping("/search")
    public ResponseResult<List<ApAssociateWords>> associate(@RequestBody UserSearchDto userSearchDto){
        List<ApAssociateWords> associateWords = associateService.associate(userSearchDto);
        return ResponseResult.okResult(associateWords);
    }
}
